<?php 
	include_once("../include/init.php");
	include_once("admin_init.php");
	$sql = "SELECT * FROM  tk_new_category";
	$res = mysql_query($sql);
	$info = [];
	if(mysql_num_rows($res)>0){
		while($list=mysql_fetch_assoc($res)){
			$info[]=$list;
		}
	}
		$info = get_cate($info);
?>

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>主体部分</title>
	<base target="_self">
	<link rel="stylesheet" type="text/css" href="skin/css/base.css" />
	<link rel="stylesheet" type="text/css" href="skin/css/main.css" />
	<script type="text/javascript" src="./skin/js/common.js"></script>

</head>
<body leftmargin="8" topmargin='8'>
	<table width="98%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px;margin-top:8px;">
	  <tr>
	    <td background="./skin/images/frame/wbg.gif" bgcolor="#EEF4EA" class='title' border="0px"><span><img src='./skin/images/frame/arr3.gif' style='margin-right:10px;'>添加管理</span></td>
		<td align="right" background="./skin/images/frame/wbg.gif" bgcolor="#EEF4EA" class='title' border="0px"></td>
	  </tr>

	  <tr bgcolor="#FFFFFF">
	  </tr>

	  </table>	 
	  	  <form action="new.php" method="post" id="form-admin-add" enctype="multipart/form-data">  	

	   		<table style="margin-bottom: 8px;margin-top: 8px;margin-left:20px;width: 80%;">

	   	<tr>
	   		<td> 标题:</td>
		   	<td> 
		   		<input type="text" name="title"  id="title" value="" class="input-text" autocomplete="off"/>
		   	</td>
	   </tr>
	    <tr>
		   	<td> 内容:</td>
		   	<td> 
		   		<?php
								include_once("./fckeditor/fckeditor.php");
								$fckeditor = new FCKeditor("content");//定义默认值 name
								$fckeditor->Width = "300px";//定义编辑器的宽度
								$fckeditor->Height = "200px";//定义编辑器的高度
								$fckeditor->Value = "";//定义默认值
								$fckeditor->BasePath='./fckeditor/';
								$fckeditor->ToolbarSet = "Basic";
								$fckeditor->Create();//创建编辑器
							?>
		   	</td>
	   </tr>
	    <tr>
	    	<td> 作者:</td>
	    	<td> <input type="text" name="author" id="author" value="" class="input-text"autocomplete="off" ></td>
	    </tr>
	    <tr>
	    	<td> 关键字:</td>
	    	<td> <input type="text" name="keyword" id="keyword" value="" class="input-text"autocomplete="off" ></td>
	    </tr>
	    <tr>
	    	<td> 描述:</td>
	    	<td> <input type="text" name="desc" id="desc" value="" class="input-text"autocomplete="off" ></td>
	    </tr>
	    <tr>
	    	<td> 新闻标题图:</td>
	    	<td> <input type="file" name="img" id="img" value="" class="input-text"autocomplete="off" ></td>
	    </tr>	    
			 <tr>

				<td width="100px;">新闻分类:</td>
				<td><select name="parent_id">


						<?php foreach( $info as $vo){?>
						<option value="<?=$vo['cate_id']?>"
							<?php
								if($vo['parent_id']==0) {
								echo "disabled";
							}
							?>							
							>
							
							<?=str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$vo['level']-1).$vo['cate_name']?>
						</option>
						<?php }?>
					</select>
				</td>
			  </tr>
					<tr style="background: #FBFCE2;">
						<td colspan="2" align="center" height="48px">
						<input type="hidden" name="act" value="add"/>
						<input calss="btn btn-primary" type="submit" value="添加"> 
						</td>
					</tr>
					</table>
				</td>
			  </tr>
			</form>			
	  <!-- data end-->
	  <!-- select start-->		 
	  <!-- select end-->
	  <!-- page start-->
	  <!-- page end-->

	</body>
</html>